type T = any
//* 登录
// 登录接口需要携带参数ts类型
export interface loginForm {
    Username: string,
    Password: string
}

// 定义接口返回的data类型
interface loginDataType {
    code: number,
    msg: string,
    data: {
        user: {
            uuid: string,
            userName: string,
            nickName: string,
            sideMode: string,
            headerImg: string,
            baseColor: string,
            activeColor: string,
            authorityId: number,
            authority: {
                CreatedAt: string,
                UpdatedAt: string,
                DeletedAt: null,
                authorityId: number,
                authorityName: string,
                parentId: null,
                dataAuthorityId: null,
                children: null,
                menus: null,
                defaultRouter: string
            },
            authorities: Array<T>,
            phone: string,
            email: string,
            enable: number,
            ID: number,
            CreatedAt: string,
            UpdatedAt: string
        },
        token: string,
        expiresAt: number
    }
}

// 登录接口返回的数据类型
export interface loginResponseData {
    data: loginDataType,
}


//* 注册
// 注册接口携带的参数
export interface registerForm {
    Username:string,
    NickName:string,
    Password:string,
    Phone:string,
    Email:string
}

// 定义接口返回的data类型
interface registerDataType {
    code: number,
    msg: string,
    data: {
        user: {
             uuid: string,
                userName: string,
                nickName: string,
                sideMode: string,
                headerImg: string,
                baseColor: string,
                activeColor: string,
                authorityId: number,
                authority: {
                    CreatedAt: string,
                    UpdatedAt: string,
                    DeletedAt: null,
                    authorityId: number,
                    authorityName: string,
                    parentId: null,
                    dataAuthorityId: null,
                    children: null,
                    menus: null,
                    defaultRouter: string
                },
                authorities: Array<T>,
                phone: string,
                email: string,
                enable: number,
                ID: number,
                CreatedAt: string,
                UpdatedAt: string
            }
    }
}
// 注册接口返回的数据类型
export interface registerResponseData {
    data: registerDataType,
}

//*用户
/* 获取用户信息 */
// 定义接口返回的data类型
interface user {
    ID: number
    uuid: string,
    userName: string,
    nickName: string,
    headerImg: string,
    sideMode: string,
    baseColor: string,
    activeColor: string,
    authorityId: number,
}
// 定义接口返回的数据类型
export interface userResponseData {
    code: number,
    data: user,
    msg: string
}
export interface UserMenuResponseData {
    code: number;
    data: {
      menus: Menu[]; // data 是一个对象，包含 menus 数组
    };
    msg: string;
  }
  
  // 定义菜单项的类型
  export interface Menu {
    parentId: string;
    path: string;
    name: string;
    title: string;
    icon: string;
    hidden: boolean;
    component: string;
    sort: number;
    authoritys: null | string[]; // 如果 authoritys 可能是数组，可以改为 string[]
    children?: Menu[]; // 子菜单也是 Menu 类型
    ID?: number; // 可选字段
    createAt?: string; // 可选字段
    UpdatedAt?: string; // 可选字段
  }